<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>登录页面</title>
    <link rel="icon" href="${ pageContext.request.contextPath}/assets/images/favicon.ico" type="image/ico">
    <link href="${ pageContext.request.contextPath}/assets/css/bootstrap.min.css" rel="stylesheet">
    <link href="${ pageContext.request.contextPath}/assets/css/materialdesignicons.min.css" rel="stylesheet">
    <link href="${ pageContext.request.contextPath}/assets/css/style.css" rel="stylesheet">
    <script type="text/javascript" src="${ pageContext.request.contextPath}/assets/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="${ pageContext.request.contextPath}/assets/js/jquery.min.js"></script>
     <script>
        var ctx = '${ pageContext.request.contextPath}';
        console.log("ctx:"+ctx)
    </script>
    <script type="text/javascript" src="${ pageContext.request.contextPath}/assets/theme.js"></script>
    <style>
        .lyear-wrapper {
            position: relative;
        }
        .lyear-login {
            display: flex !important;
            min-height: 100vh;
            align-items: center !important;
            justify-content: center !important;
        }
        .lyear-login:after{
            content: '';
            min-height: inherit;
            font-size: 0;
        }
        .login-center {
            background: rgba(85, 80, 80, 0.67);
            min-width: 29.25rem;
            padding: 2.14286em 3.57143em;
            border-radius: 3px;
            margin: 2.85714em;
        }
    </style>
</head>

<body>
<div class="row lyear-wrapper loginBg">
  <div class="lyear-login">
    <div class="login-center">
      <h2 style="width: 100%;text-align: center;color:white">个性化习题管理系统</h2>
      <form action="${ pageContext.request.contextPath}/login" method="post">
        <div class="form-group">
          <input value="${username}" maxlength="12" type="text" placeholder="请输入您的用户名" class="form-control" name="username" id="username" />
        </div>
        <div class="form-group">
          <input value="${password}" type="password" placeholder="请输入密码" class="form-control" id="password" name="password" />
        </div>
        
        <div class="form-group row">
          <div class="col-xs-7">
            <input type="text" name="captcha" class="form-control" placeholder="验证码">
          </div>
          <div class="col-xs-5">
            <img src="${ pageContext.request.contextPath}/captcha" class="pull-right" id="captcha" style="cursor: pointer;" onclick="this.src=this.src+'?d='+Math.random();" title="点击刷新" alt="captcha">
          </div>
        </div>
        
        <div class="form-group" style="display:flex;justify-content : center;color: white">
          <input type="radio" name="usertype" value="admin" id="管理员"> <label for="管理员">管理员</label>
          <input checked type="radio" name="usertype" value="user" id="用户"> <label for="用户">用户</label>
        </div>
        <div class="form-group">
          <button class="btn btn-block btn-primary" type="submit">立即登录</button>
        </div>
        <footer class="text-center" style="color: whitesmoke">
        <p class="m-b-0">没有账号？<a href="register.jsp" style="color: #abb7e8">立即注册</a></p>
        </footer>
        <c:if test="${ not empty message}">
          <div class="alert alert-danger" role="alert">${ message}</div>
        </c:if>
      </form>
      <hr>
      
    </div>
  </div>
</div>
</body>
</html>

